package com.imooc.article.stream;

import com.imooc.pojo.AppUser;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * @Project_name: imooc-news-dev
 * @Description:
 * @Author: Levi
 * @Date: 2021/4/2 16:27
 */
@Component
@EnableBinding(MyStreamChannel.class)
public class MySteamConsumer {

    @StreamListener(MyStreamChannel.INPUT)
    public void receiveMessage(AppUser user) {
        System.out.println("消费者监听接收消息并执行相关业务~~");
        System.out.println(user);
    }
}
